[PATCH] FFI: Fix pass small ints in foreign call wrappers
authorPeter Trommler <ptrommler@acm.org>
Thu, 11 Jun 2020 06:31:22 +0000 (08:31 +0200)
committerIlias Tsitsimpis <iliastsi@debian.org>
Tue, 11 Aug 2020 14:12:43 +0000 (15:12 +0100)
commitf41afc81ee17cd0fcdf677e58cb2348274522142
tree527a92aeb5a26ea1cc25709cea45de2f5c80c172
parentff9c7bd1234f371d16c2f5eb1496dc2a6b2e0b4c
[PATCH] FFI: Fix pass small ints in foreign call wrappers

The Haskell calling convention requires integer parameters smaller
than wordsize to be promoted to wordsize (where the upper bits are
don't care). To access such small integer parameter read a word from
the parameter array and then cast that word to the small integer
target type.

Fixes #15933

Gbp-Pq: Name fix-big-endian-ffi
compiler/deSugar/DsForeign.hs